package com.wlyy.his.controller.common;

import com.wlyy.his.ali.oss.AliOSSUtil;
import com.wlyy.his.common.api.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @ClassName ImageController
 * @Description TODO
 * @Author zhouyanhui
 * @Date 2021-09-02 21:32
 * @Version 1.0
 **/
@RestController
@RequestMapping("/image")
public class ImageController {
    @Autowired
    private AliOSSUtil aliOSSUtil;

    @PostMapping("/upload")
    public CommonResult upload(MultipartFile file) {
        String url = aliOSSUtil.uploadFile(file);
        return CommonResult.success(url);
    }
}
